using Admin.NET.Core;
using Microsoft.AspNetCore.Http;
using MOKA.TPM.Entity;
using System.ComponentModel.DataAnnotations;

namespace MOKA.TPM.Service.Dto;

/// <summary>
/// 页面输出参数 （点检记录）
/// </summary>
public class CheckupOutput : Checkup
{
    /// <summary>
    /// TPM设备分组 （字典名称）
    /// </summary>
    public string? TPMDeviceGroupName { get; set; }

    /// <summary>
    /// 点检周期 （字典名称）
    /// </summary>
    public string? CheckupCycleName { get; set; }

    /// <summary>
    /// 点检结果 （字典名称）
    /// </summary>
    public string? CheckupResultName { get; set; }

    /// <summary>
    /// 点检人 （字典或人员名称）
    /// </summary>
    public string? CheckupManName { get; set; }

    /// <summary>
    /// 点检任务状态 （字典或人员名称）
    /// </summary>
    public string? CheckupStatusName { get; set; }

    /// <summary>
    /// 创建用户 （字典或人员名称）
    /// </summary>
    public string? CreateUserName { get; set; }

    /// <summary>
    /// 更新用户 （字典或人员名称）
    /// </summary>
    public string? UpdateUserName { get; set; }
}

/// <summary>
/// 单ID查询参数
/// </summary>
public class CheckupInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid? Id { get; set; }

    /// <summary>
    /// 点检周期
    /// </summary>
    public Guid? CheckupCycle { get; set; }  //唯一索引

    /// <summary>
    /// 当前周期
    /// </summary>
    public string? CurrentCycle { get; set; }  //唯一索引

    /// <summary>
    /// 设备编号
    /// </summary>
    public Guid? EquipmentId { get; set; }  //唯一索引
}

/// <summary>
/// 普通查询参数
/// </summary>
public class GetCheckupInput : BaseOrderInput
{
    /// <summary>
    /// 点检周期
    /// </summary>
    public Guid? CheckupCycle { get; set; }  //唯一索引

    /// <summary>
    /// 当前周期
    /// </summary>
    public string? CurrentCycle { get; set; }  //唯一索引

    /// <summary>
    /// 设备编号
    /// </summary>
    public Guid? EquipmentId { get; set; }  //唯一索引

    /// <summary>
    /// </summary>
    public string? EquipmentNo { get; set; }

    /// <summary>
    /// </summary>
    public string? EquipmentName { get; set; }

    /// <summary>
    /// </summary>
    public Guid? TPMCategoryId { get; set; }

    /// <summary>
    /// </summary>
    public string? Position { get; set; }

    /// <summary>
    /// </summary>
    public string? ManagerNo { get; set; }

    /// <summary>
    /// </summary>
    public string? CheckupMan { get; set; }
}

/// <summary>
/// 分页查询参数
/// </summary>
public class PageCheckupInput : BasePageInput
{
    /// <summary>
    /// 点检周期
    /// </summary>
    public Guid? CheckupCycle { get; set; }  //唯一索引

    /// <summary>
    /// 当前周期
    /// </summary>
    public string? CurrentCycle { get; set; }  //唯一索引

    /// <summary>
    /// 设备编号
    /// </summary>
    public Guid? EquipmentId { get; set; }  //唯一索引
}

/// <summary>
/// 新增记录参数
/// </summary>
public class AddCheckupInput
{
    /// <summary>
    /// 设备编号
    /// </summary>
    public Guid EquipmentId { get; set; }

    /// <summary>
    /// TPM设备分组
    /// </summary>
    public Guid TPMDeviceGroupId { get; set; }

    /// <summary>
    /// 点检任务
    /// </summary>
    public Guid? CheckupTaskId { get; set; }

    /// <summary>
    /// 点检周期
    /// </summary>
    public Guid CheckupCycle { get; set; }

    /// <summary>
    /// 当前周期
    /// </summary>
    [Required, MaxLength(50)]
    public string CurrentCycle { get; set; } = string.Empty;

    /// <summary>
    /// 点检人
    /// </summary>
    [Required, MaxLength(20)]
    public string CheckupMan { get; set; } = string.Empty;

    /// <summary>
    /// 点检日期
    /// </summary>
    public DateTime CheckupTime { get; set; }

    /// <summary>
    /// 点检任务状态
    /// </summary>
    public Guid? CheckupStatus { get; set; }

    /// <summary>
    /// 点检结果
    /// </summary>
    public Guid CheckupResult { get; set; }

    /// <summary>
    /// 图片存储标志
    /// </summary>
    public long? ImageId { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    /// 确认人
    /// </summary>
    [MaxLength(20)]
    public string? ConfirmMan { get; set; }

    /// <summary>
    /// 确认时间
    /// </summary>
    public DateTime? ConfirmTime { get; set; }

    /// <summary>
    /// 创建用户
    /// </summary>
    [Required, MaxLength(20)]
    public string CreateUser { get; set; } = string.Empty;

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 更新用户
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 子表：点检记录详情
    /// </summary>
    public List<AddCheckupDetailInput> CheckupDetails { get; set; }//一对多
}

/// <summary>
/// 更新参数
/// </summary>
public class UpdateCheckupInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 设备编号
    /// </summary>
    public Guid EquipmentId { get; set; }

    /// <summary>
    /// TPM设备分组
    /// </summary>
    public Guid TPMDeviceGroupId { get; set; }

    /// <summary>
    /// 点检任务
    /// </summary>
    public Guid? CheckupTaskId { get; set; }

    /// <summary>
    /// 点检周期
    /// </summary>
    public Guid CheckupCycle { get; set; }

    /// <summary>
    /// 当前周期
    /// </summary>
    [MaxLength(50)]
    public string CurrentCycle { get; set; }

    /// <summary>
    /// 点检人
    /// </summary>
    [MaxLength(20)]
    public string CheckupMan { get; set; }

    /// <summary>
    /// 点检日期
    /// </summary>
    public DateTime? CheckupTime { get; set; }

    /// <summary>
    /// 点检任务状态
    /// </summary>
    public Guid? CheckupStatus { get; set; }

    /// <summary>
    /// 点检结果
    /// </summary>
    public Guid? CheckupResult { get; set; }

    /// <summary>
    /// 图片存储标志
    /// </summary>
    public long? ImageId { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    /// 确认人
    /// </summary>
    [MaxLength(20)]
    public string? ConfirmMan { get; set; }

    /// <summary>
    /// 确认时间
    /// </summary>
    public DateTime? ConfirmTime { get; set; }

    /// <summary>
    /// 创建用户
    /// </summary>
    [MaxLength(20)]
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 更新用户
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 子表：点检记录详情
    /// </summary>
    public List<CheckupDetail> CheckupDetails { get; set; }//一对多
}

/// <summary>
/// 删除参数
/// </summary>
public class DeleteCheckupInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid Id { get; set; }
}

/// <summary>
/// 更新部分数据参数
/// </summary>
public class UpdateSomeCheckupInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 点检周期
    /// </summary>
    public string? CheckupCycle { get; set; }  //唯一索引

    /// <summary>
    /// 当前周期
    /// </summary>
    public string? CurrentCycle { get; set; }  //唯一索引

    /// <summary>
    /// 设备编号
    /// </summary>
    public string? EquipmentId { get; set; }  //唯一索引
}